package com.lgl.scs.system.controller;

import com.lgl.scs.base.controller.BaseController;
import com.lgl.scsapi.system.model.PageData;
import org.springframework.stereotype.Controller;

import javax.servlet.http.HttpServletRequest;
/*
 * 总入口
 */
@Controller
public class LoginController extends BaseController {

	/**
	 * 获取登录用户的IP
	 * @throws Exception 
	 */
	public void getRemortIP(String USERNAME) throws Exception {  
		PageData pd = new PageData();
		HttpServletRequest request = this.getRequest();
		String ip = "";
		if (request.getHeader("x-forwarded-for") == null) {  
			ip = request.getRemoteAddr();  
	    }else{
	    	ip = request.getHeader("x-forwarded-for");  
	    }
		pd.put("USERNAME", USERNAME);
		pd.put("IP", ip);
		//userService.saveIP(pd);
	}

}